package Test_Connexion;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.ResultSet;
import java.sql.Statement;

public class Etudiant {
	public static void main(String[] args) {
        try {
               Class.forName("com.mysql.jdbc.Driver");
               Connection con = DriverManager.getConnection("jdbc:mysql://localhost/mysql?user=root&password=abc");
               Statement st = con.createStatement();
               st. execute("use test");
               ResultSet rs = st.executeQuery("select * from etudiant;");

               while(rs.next()) {
                   System.out.println( rs.getString("Nom"));                   
               }
               st.close();
               rs.close();
               con.close();
       } catch (Exception ex) {
               ex.printStackTrace();
       }
   }
}


